package com.soft.flink.ing;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

@Component
public class Execution implements ApplicationRunner {

    @Value("${source.socket.host}")
    private String host;

    @Value("${source.socket.port}")
    private int port;

    @Value("${flink.window.size}")
    private long windowSize;

    @Autowired
    private SocketWindowWordCount wordCount;

    @Override
    public void run(ApplicationArguments args) throws Exception {
        // 启动任务
        wordCount.wordCount(host, port, windowSize);
    }
}